Quantum cascade lasers provide a tunable mid-infrared (MIR) light source that can be used for spectroscopic measurements and images. Many chemical components of interest have molecular vibrations that are excited in the MIR region of the optical spectrum, which spans wavelengths between 5 to 25 microns. Hence, measuring the absorption of MIR light at various locations on a sample can provide useful information about the chemistry of the sample as a function of position on the sample. Samples that are not flat and parallel to the imaging plane present challenges. In particular, parts of the sample will be out of focus which limits the resolution of the image in areas that are not in focus.